package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.mappers.OptionsMapper;
import com.tanhua.model.domain.Options;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 问题选项数据层实现类
 *
 * @author 李磊
 * @since 2022-01-14 10:36
 */
@DubboService
public class OptionsApiImpl implements OptionsApi {

    @Autowired
    OptionsMapper optionsMapper;

    /**
     * 说明:  根据问题id查询对应的所有的选项
     *
     * @param soulQuestionId 问题id
     * @return java.util.List<com.tanhua.model.domain.Options>
     * @author 李磊
     * @since 2022-01-14 13:23
     */
    @Override
    public List<Options> findByQuestionId(Long soulQuestionId) {
        return optionsMapper.findByQuestionId(soulQuestionId);
    }

    /**
     * 说明:  根据选项id查询对应的分数
     *
     * @param optionsId 选项id
     * @return java.lang.Integer
     * @author 李磊
     * @since 2022-01-14 17:55
     */
    @Override
    public Integer findScoreById(Long optionsId) {
        return optionsMapper.findScoreById(optionsId);
    }
}
